<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWithdrawFundsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('withdraw_funds', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedInteger('user_id')->comment('用户');
            $table->unsignedInteger('amount')->comment('金额');
            $table->unsignedDecimal('actual_amount')->comment('实际到账金额');
            $table->unsignedTinyInteger('status')->default(1)->comment('状态 1待审核 2审核通过 3审核失败');
            $table->string('fail_reason')->nullable()->comment('失败原因');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('withdraw_funds');
    }
}
